package config

import (
    "flag"
    "fmt"
)

var (
    localTest     = flag.Bool("local-test", false, "(optional) in cluster config")
    aPIServerPort = flag.Int("api-server-port", 41000, "(optional) API server port")
    singerPort    = flag.Int("singer-port", 41001, "(optional) Singer port")
)

var (
    LocalTest     bool
    APIServerPort int
    SingerPort    int
    FeedbackUrl   string
)

func Init() {
    flag.Parse()
    LocalTest = *localTest
    APIServerPort = *aPIServerPort
    SingerPort = *singerPort

    if LocalTest {
        FeedbackUrl = fmt.Sprintf("http://%s:%d/v1/feedback", Localhost, APIServerPort)
    } else {
        FeedbackUrl = fmt.Sprintf("http://%s.%s:%d/v1/feedback", SystemName, SystemNamespace, APIServerPort)
    }
}
